import React from 'react';
import './address.scss';

export interface AddressProps {
    isDefault?: boolean;
    tags?: string[];
    addressId?: string | number;
    addressDetail?: string;
    addressCity?: string;
    phone?: string;
    cityId?: string | number;
    cityName?: string;
    countyId?: string | number;
    countyName?: string;
    provinceId?: string | number;
    provinceName?: string;
    name?: string;
    selected?: boolean;
}

const defaultProps = {
    isDefault: true,
    tags: [],
    addressId: '',
    addressCity: '浙江杭州市萧山区盈丰街道',
    addressDetail: '顺发美哉美城2号楼1单元13层1302',
    phone: '123456789',
    cityId: '',
    cityName: '',
    countyId: '',
    countyName: '',
    provinceId: '',
    provinceName: '',
    name: '你好'
}

const Address: React.FC<AddressProps> = (props) => {
    const {
        isDefault,
        tags,
        addressId,
        addressCity,
        addressDetail,
        phone,
        cityId,
        cityName,
        countyId,
        countyName,
        provinceId,
        provinceName,
        name,
        ...rest
    } = {
        ...defaultProps,
        ...props
    };
    return (
        <div className='seal-address'>
            <div className='seal-address__wrap'>
                <div className='seal-address__info'>
                    {
                        isDefault && (
                            <div className='seal-address__info-tag seal-address__info-tag-default'>
                                默认
                            </div>
                        )
                    }
                    <div className='seal-address__info-tag seal-address__info-tag-other' >家</div>
                    <div className='seal-address__info-title'>{addressCity}</div>
                </div>
                <div className='seal-address__main'>
                    <div className='seal-address__detail'>{addressDetail}</div>
                </div>

                <div className='seal-address__phone'>
                    {name}&nbsp;&nbsp;{phone}
                </div>
            </div>
        </div>
    )
}

export default Address;